# 名字必须叫tasks
from celery_tasks.main import celery_app
from . import constants
from . yuntongxun.sms import CCP


# 定义任务
@celery_app.task(name='send_sms_code')  # 任务别名
def send_sms_code(mobile, sms_code):
    """
    发送短信验证码异步任务
    :return:
    """
    CCP().send_template_sms(mobile, [sms_code, constants.SMS_CODE_REDIS_EXPIRES // 60], 1)